import { useDispatch, useSelector } from "react-redux";
import { Upload } from '@comps'
import { apiRequest } from '@u'
import { Form } from "antd";
import { useEffect } from "react";


export default function Index () {
   const global = useSelector(state => state.global); //仓库方法
   const dispatch = useDispatch();
   const { FS_QINIU_DOMAIN, FS_QINIU_ASSETS_DIR, FS_SOCKET_URL } = window.env;

   useEffect(() => {
      var ws = new WebSocket(FS_SOCKET_URL)
      ws.onopen = function () { }
      ws.onmessage = function (e) { }
   }, [])

   return (
      <div>
         <h1>Welcome @peace</h1>
         <Form
            initialValues={{
               up: [{
                  uid: -1,
                  url: `/temp_v5/20240913155734/-511108760.png`
               }]
            }}
         >
            <Form.Item name="up">
               <Upload
                  maxCount={2}
                  listType='picture-card'
                  // types={['png']}
                  onChange={(fileList) => {
                     console.log(fileList)
                  }}
               >
                  <span>上传文件</span>
               </Upload>
            </Form.Item>
         </Form>
      </div>
   );
}
